Skip to content

Limit clang-tidy CI to changed files on branch workflows#390

Merged
rolandreichweinbmw merged 1 commit intoeclipse-openbsw:mainfrom
simon-d-bmw:gh-381-limit-clang-tidy-ci-scope
Mar 17, 2026
Merged

Limit clang-tidy CI to changed files on branch workflows#390
rolandreichweinbmw merged 1 commit intoeclipse-openbsw:mainfrom
simon-d-bmw:gh-381-limit-clang-tidy-ci-scope

Conversation

@simon-d-bmw
Copy link
Contributor

@simon-d-bmw simon-d-bmw commented Mar 12, 2026

Summary

  • run clang-tidy on changed .c, .cc, .cpp, .h, .hh, .hpp, and .hxx files for pull requests
  • skip clang-tidy cleanly when no C/C++ files changed in a pull request
  • keep the full clang-tidy scan for pushes to main and for merge queue runs

Details

  • add .ci/determine-clang-tidy-scope.py: computes execution scope from the GitHub event payload and writes mode / has_changes step outputs
    • pull_request → changed mode: only files touched by the PR are analyzed
    • merge_group → full mode: pre-merge gate keeps the complete repository scan
    • push to main → full mode: post-merge safety net
    • push to non-main branches → silently ignored (no clang-tidy run)
  • keep the existing clang-tidy findings export and reporting flow
  • treat an empty clang-tidy findings YAML as zero findings so filtered runs do not fail when no diagnostics are emitted
  • update the developer documentation to describe the trigger-vs-scope behavior

Refs #381

@simon-d-bmw
Copy link
Contributor Author

CI scope validation campaign summary (branch-event changed-scope behavior):

  • Validation completed across 8 scenarios with posix + s32k1xx matrix jobs.
  • Overall result: successful; no workflow crashes in scope or resolver path.
  • S01 is considered a scenario-selection limitation (changed header not included in analyzed target set), not a resolver mismatch.
  • S08 confirms the mapped-header positive case (header-only change resolved to many TUs on both matrix jobs).
  • S07 (merge-history) passed with merge commit + follow-up commit.

Validation PR references (all test PRs now closed):

@simon-d-bmw simon-d-bmw force-pushed the gh-381-limit-clang-tidy-ci-scope branch from 21244c4 to 3769f82 Compare March 17, 2026 05:25
…nbsw#381)

Run the full clang-tidy scan only on pushes to main.
Use changed C/C++ files for pull requests.

Treat an empty findings YAML as zero findings so
changed-file clang-tidy runs do not fail when no
diagnostics are emitted.
@simon-d-bmw simon-d-bmw force-pushed the gh-381-limit-clang-tidy-ci-scope branch from 3769f82 to 772e9c1 Compare March 17, 2026 07:52
@rolandreichweinbmw rolandreichweinbmw merged commit e0cb955 into eclipse-openbsw:main Mar 17, 2026
167 checks passed
@simon-d-bmw simon-d-bmw deleted the gh-381-limit-clang-tidy-ci-scope branch March 17, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants